<% content_for :title do %>Adressenboek<% end %>

<% @addresses.each do |address|  %>

  <table>
    <tr>
      <th colspan="2"><%=h address.name %></th>
    </tr>
    <tr class="<%=row_class%>">
      <td>Adres:</td>
      <td><%=address.street+" "+address.house_number.to_s%>
        <%if(address.house_number_addition.to_s != "") then%>
          <%="/"+address.house_number_addition%></td>
        <%end%>
    </tr>
    <tr class="<%=row_class%>">
      <td>Postcode:</td>
      <td><%=address.postal_code%></td>
    </tr>
    <tr class="<%=row_class%>">
      <td>Plaats:</td>
      <td><%=address.city%></td>
    </tr>
    <tr class="<%=row_class%>">
      <td>Telefoonnummer:</td>
      <td><%=address.telephone_number%></td>
    </tr>
    <% unless(address.mobile_number.blank?) then%>
      <tr class="<%=row_class%>">
        <td>Mobiel:</td>
        <td><%=address.mobile_number%></td>
      </tr>
    <%end%>
    <%  unless(address.fax_number.blank?) then%>
      <tr class="<%=row_class%>">
        <td>Fax:</td>
        <td><%=address.fax_number%></td>
      </tr>
    <%end%>
    <% unless(address.company.blank?) then%>
      <tr class="<%=row_class%>">
        <td>Bedrijf:</td>
        <td><%=address.company%></td>
      </tr>
    <%end%>
  </table>

<p>
  <%=link_to 'Aanpassen', edit_account_address_path(address) %> |
  <%=link_to 'Verwijderen', account_address_path(address), :method => :destroy, :confirm => 'Weet u dit zeker?' %>
</p>

<% end %>

<p>
  <%=link_to 'Nieuw adres toevoegen', new_account_address_path %>
</p>